package com.example.sqlite;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.example.sqlite.sqlit_Litepal.Activity_LitePal;
import com.example.sqlite.sqlite_native.Activity_sqlite_native;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Button sqlite_native = (Button) findViewById(R.id.sqlite_native);
        Button sqlit_Litepal = (Button) findViewById(R.id.sqlit_Litepal);

        sqlite_native.setOnClickListener(this);
        sqlit_Litepal.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent intent = null;
        switch (v.getId()) {
            case R.id.sqlite_native:
                intent = new Intent(MainActivity.this, Activity_sqlite_native.class);
                break;
            case R.id.sqlit_Litepal:
                intent = new Intent(MainActivity.this, Activity_LitePal.class);
                break;
        }
        startActivity(intent);
    }
}